package com.first.xiinn.model;

import java.sql.Timestamp;
import java.util.Date;

import org.hibernate.dialect.TimesTenDialect;

import com.first.core.util.UUID;

public class Comment {

	private String id;
	
	private String userId;
	
	private String parentId;
	
	private String title;
	
	private String content;
	
	private BookManager book;
	
	/**
	 * 评论类型，
	 * 1：书籍评论
	 * 2：引用评论评论
	 * 3：话语评论
	 */
	private String type;
	
	/**
	 * 鲜花
	 */
	private int flowers;
	
	/**
	 * 鸡蛋
	 */
	private int egges;
	
	/**
	 * 创建时间
	 */
	private Date createDate;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getFlowers() {
		return flowers;
	}

	public void setFlowers(int flowers) {
		this.flowers = flowers;
	}

	public int getEgges() {
		return egges;
	}

	public void setEgges(int egges) {
		this.egges = egges;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		if(createDate==null){
			createDate = new Date();
		}
		this.createDate = createDate;
	}
	

	public BookManager getBook() {
		return book;
	}

	public void setBook(BookManager book) {
		this.book = book;
	}
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Override
	public String toString() {
		return "Comment [content=" + content
				+ ", createDate=" + createDate + ", egges=" + egges
				+ ", flowers=" + flowers + ", id=" + id + ", parentId="
				+ parentId + ", type=" + type + ", userId=" + userId + "]";
	}
	
}
